package com.legal.domain.po.practice_view;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>刷题记录详情视图</p>
 *
 * @author xiaopeng
 * @since 2025-06-27
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("record_details_view")
@Schema(name = "RecordDetailsView", description = "刷题记录详情视图")
public class RecordDetailsView implements Serializable {

    private static final long serialVersionUID = 1L;

    // 添加一个逻辑主键字段（选择视图中能唯一标识记录的字段）
    @TableId(type = IdType.INPUT)  // INPUT表示使用自定义ID
    @Schema(description = "逻辑主键（记录详情表的编号）", example = "1")
    private String id;

    @Schema(description = "关联的刷题记录编号", example = "REC20250001")
    private String recordNo;

    @Schema(description = "题目类型(1单选 2多选 3判断 4填空 5简答)", example = "1")
    private Integer questionType;

    @Schema(description = "题目内容", example = "Java中final关键字的作用是什么？")
    private String content;

    @Schema(description = "选项(JSON格式)", example = "{\"A\":\"修饰变量\",\"B\":\"修饰方法\",\"C\":\"修饰类\"}")
    private String options;

    @Schema(description = "正确答案", example = "A,B,C")
    private String correctAnswer;

    @Schema(description = "答案解析", example = "final关键字可以修饰变量、方法和类")
    private String explanation;

    @Schema(description = "题目难度(1-5)", example = "3")
    private Integer difficulty;

    @Schema(description = "是否启用(1启用 0禁用)", example = "1")
    private Integer isActive;

    @Schema(description = "所属分类名称", example = "Java基础")
    private String categoryName;

    @Schema(description = "用户提交的答案", example = "A,C")
    private String userAnswer;

    @Schema(description = "是否正确(1正确 0错误)", example = "1")
    private Integer isCorrect;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @Schema(description = "记录创建时间", example = "2025-06-27")
    private LocalDateTime createTime;
}
